﻿<UserControl x:Class="GSF.TimeSeries.UI.Editors.MeasurementEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:uc="clr-namespace:GSF.TimeSeries.UI.UserControls"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             Width="500" KeyDown="MeasurementEditor_KeyDown">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/GSF.TimeSeries.UI.WPF;Component/Resources/CommonResource.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        
        <Label Grid.Row="0" Grid.Column="0" Content="Filter Expression" Visibility="{Binding ElementName=FilterExpressionTextBox, Path=Visibility}" />
        <TextBox Grid.Row="0" Grid.Column="1" Name="FilterExpressionTextBox" Width="Auto" Height="{StaticResource XSmallItemSize}" HorizontalAlignment="Stretch"
                 TextWrapping="Wrap" TextChanged="FilterExpressionTextBox_TextChanged" ScrollViewer.VerticalScrollBarVisibility="Visible" />

        <uc:MeasurementPagerUserControl Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="MeasurementPager" ItemsPerPage="18" Selectable="True" Searchable="True" Loaded="MeasurementPager_Loaded" SelectedMeasurementsChanged="MeasurementPager_SelectedMeasurementsChanged" Button.Click="MeasurementPager_ButtonClick" />
        
        <StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Margin="5" Content="OK" IsDefault="True" Click="OKButton_Click" />
            <Button Margin="5" Content="Cancel" IsCancel="True" />
        </StackPanel>
    </Grid>
</UserControl>
